<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateTableFieldsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('table_fields', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 100)->comment('字段名');
            $table->string('title', 100)->nullable()->comment('字段别名');
            $table->integer('table_id')->default(0)->nullable()->unsigned()->comment('表名');
            $table->string('field_type', 100)->nullable()->comment('字段属性');
            $table->string('field_filter', 100)->nullable()->comment('视图过滤');
            $table->string('column_width', 100)->nullable()->comment('视图(宽度)');
            $table->string('rw', 100)->nullable()->comment('读写');
            $table->string('form', 100)->nullable()->comment('表单输入');
            $table->string('attr')->nullable()->comment('JSON编辑');
            $table->string('description')->nullable()->comment('说明');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('table_fields');
    }
}
